import org.junit.Test;

public class NGuessNumberTest extends NGuessNumber {

    public void generateAnswerTest() {
        NGuessNumber nGuessNumber = new NGuessNumber();
        int e[] = nGuessNumber.generateAnswer();

        //判断是不是四个数
        if (e.length == 4) {
            //判断是不是每个数都不相等
            for (int i = 0; i < e.length - 1; i++) {
                for (int j = e.length - 1; j > i; j--) {
                    if (e[i] != e[j]) {
                        //判断是不都是一位数
                        if (0 < e[i] && e[i] < 9) {
                            System.out.println("满足要求");
                        }
                    }
                }
            }
        }
        generateAnswer();
    }public void getPlayerInputTest(){
        NGuessNumber nGuessNumber = new NGuessNumber();
        int f[] =nGuessNumber.getPlayerInput();
        if (f.length==4){
            System.out.println("玩家输入了四个数");
        }
    }

    public static void main(String[] args) {


    }
    @Test
    public int iswin() {
        NGuessNumber nGuessNumber = new NGuessNumber();
        int A=nGuessNumber.iswin();
        if (A==4){
            System.out.println("true");
        }else{
            System.out.println("false");
        }
        return A;
    }
}
